<template>
	<view style="background-color: #f1f1f1;height: 180vh;">
		<view class="top">
			<view class="two">
				<u--form :model="form" ref="uForm" :rules="rules">
				<view class="two-one">
					<view class="two-oneLeft" >单号 :</view>
					<view class="two-oneRight">{{dataFormat.YSSQNUM}}</view>
				</view>
				<view class="two-one">
					<view class="two-oneLeft" >日期 :</view>
					<view class="two-oneRight">{{dataFormat.YDAT}}</view>
				</view>
				<view class="two-one">
					<view class="two-oneLeft" >地点 :</view>
				</view>
				<view style="width: 70%;margin: 0 auto;margin-top: -50rpx;margin-left: 170rpx;">
					<uni-data-select :disabled="dataFormat.YSSQNUM!=''" v-model="dataFormat.FCY" :localdata="range" @change="changeFCY" :clear="false">
					</uni-data-select>
				</view>
				<view class="two-one">
					<view class="two-oneLeft" >领料人 :</view>
				</view>
				 <view style="width: 70%;margin: 0 auto;margin-top: -50rpx;margin-left: 170rpx;">
				 	<uni-combox v-model="dataFormat.YUSRNAM" :candidates="yusrlist" @input=""
				 		placeholder="请选择" emptyTips="无数据" 
				 	></uni-combox>
				 </view>
				<view class="two-one">
					<view class="two-oneLeft" >库管员 :</view>
				</view>
				<view style="width: 70%;margin: 0 auto;margin-top: -50rpx;margin-left: 170rpx;">
					<uni-data-select :disabled="dataFormat.YSSQNUM!=''" v-model="dataFormat.YLLKF" :localdata="ast15001" @change="" :clear="false">
					</uni-data-select>
				</view>
				<view class="two-one">
					<view class="two-oneLeft" >仓库 :</view>
				</view>
				 <view style="width: 70%;margin: 0 auto;margin-top: -50rpx;margin-left: 170rpx;">
				 	<uni-combox v-model="dataFormat.LOCTYP" :candidates="loctyplist" @input=""
				 		placeholder="请选择" emptyTips="无数据" 
				 	></uni-combox>
				 </view>
				 <view class="two-one">
				 	<view class="two-oneLeft" >状态 :</view>
				 </view>
				 <view style="width: 70%;margin: 0 auto;margin-top: -50rpx;margin-left: 170rpx;">
				 	<uni-data-select :disabled="true" v-model="dataFormat.YSTAT" :localdata="ast1155" @change="" :clear="false">
				 	</uni-data-select>
				 </view>
				 <view class="two-one">
				 	<view class="two-oneLeft" >关闭原因 :</view>
				 </view>
				 <view style="width: 70%;margin: 0 auto;margin-top: -40rpx;margin-left: 170rpx;">
				 	<u-input placeholder="请输入关闭原因" v-model="dataFormat.YGBYY" />
				 </view>
				 <view class="two-one">
				 	<view class="two-oneLeft" >设备号 :</view>
				 </view>
				 <view style="width: 70%;margin: 0 auto;margin-top: -40rpx;margin-left: 170rpx;">
				 	<u-input placeholder="请输入设备号" v-model="dataFormat.YSBITM" />
					<u-button  type="success" size="mini" :plain="true"  text="填充明细"
						@click="ysubitm()">
					</u-button>
				 </view>
				 <view class="filter-container">
				   <view class="filter-label">筛选:</view>
				   <div style="display: flex; margin-bottom: 1px;">
				   <u-input class="filter-input" placeholder="设备" v-model="dataFormat.yfsb" />
				   <u-input class="filter-input" placeholder="件号" v-model="dataFormat.yfjh" />
				   <u-input class="filter-input" placeholder="材料类别" v-model="dataFormat.yflb" />
					</div>
				 </view>
				</u--form>
					<uni-td >
						<u-button  type="primary" size="mini" :plain="true"  text="提料单选择" 
							@click="showYSLModal()">
						</u-button>
					</uni-td >
						<uni-td >
							<u-button  type="primary" size="mini" :plain="true"  text="库存选择"
								@click="showSTOModal()">
							</u-button>
						</uni-td >
					<view class="table-container" style="margin-left: -30rpx;">
						<uni-table type=""  border stripe emptyText="暂无更多数据">
							<uni-tr>
								<uni-th width="20">操  作</uni-th>
								<uni-th width="200">设备</uni-th>
								<uni-th width="100">件号</uni-th>
								<uni-th width="120">零件名称</uni-th>
								<uni-th width="80">材料编码</uni-th>
								<uni-th width="80">可使用数量</uni-th>
								<uni-th width="110">申请数量</uni-th>
								<uni-th width="80">出库数量</uni-th>
								<uni-th width="80">材质牌号</uni-th>
								<uni-th width="80">规格型号</uni-th>
								<uni-th width="80">技术标准</uni-th>
								<uni-th width="80">附加技术要求</uni-th>
								<uni-th width="100">备注</uni-th>
							</uni-tr>
								<uni-tr v-for="(item,index) in dataList" id='index'>
									<uni-td >
										<u-button type="warning "  :plain="true" text="删除" @click="deleteData(index)"></u-button>
									</uni-td>
									<uni-td>
										<!-- <u-input  placeholder="请 输入" v-model="item.YSBITM" /> -->
										<uni-combox v-model="item.YSBITM" :candidates="sblist" @input="inputYsbList(item)"
											placeholder="请选择" emptyTips="无数据" @change="changeYsbRang(item)"
										></uni-combox>
									</uni-td>
									<uni-td >
										<u-input  placeholder="请输入" v-model="item.YJH" />
									</uni-td>
									<uni-td>{{item.YLJDES}}</uni-td>
									<uni-td>{{item.CPNITMREF}}</uni-td>
									<uni-td>{{item.YKQTY}}</uni-td>
									<uni-td style="" >
										<u-input @blur="changeqty(item)" type="digit" placeholder="请输入" v-model="item.YSQTY" />
									</uni-td>
									<uni-td>{{item.YLCKQTY}}</uni-td>
									<uni-td>{{item.YCZPH}}</uni-td>
									<uni-td>{{item.YGGXH}}</uni-td>
									<uni-td>{{item.YJSBZ}}</uni-td>
									<uni-td>{{item.YFJJSYQ}}</uni-td>
									<uni-td style="" >
										<u-input  placeholder="请输入" v-model="item.YBZ" />
									</uni-td>
								</uni-tr>
						</uni-table>
					</view>
					</div>
					
				<!-- </view> -->
			</view>
		</view>
		<div class="" style="margin-top: 80rpx;">
			<view class=""  v-if="dataFormat.YSSQNUM==''" >
				<u-button class="rgzxBox-btn2" type="success"
				@click="creBtn">创建</u-button>
			</view>
			<view class="" style="margin-top: 10rpx;" v-if="dataFormat.YSSQNUM!='' & dataFormat.YSTAT==1">
				<u-button class="rgzxBox-btn2" type="primary  "
				@click="subBtn">提交</u-button>
			</view>
			<view class="four-item" style="margin-top: 10rpx;" v-if="isclose==true">
				<u-button class="rgzxBox-btn2" type="primary "
				@click="cloBtn">关闭</u-button>
			</view>
			<view class="four-item">
				<u-button class="rgzxBox-btn2" style="margin-top: 10rpx;" type="error"
				@click="outBtn">退出</u-button>
			</view>
		</div>
	</view>
</template>

<script>
	import * as dd from 'dingtalk-jsapi'
	import { format } from 'date-fns/format.js';
import { getDate } from 'date-fns';
	export default {
		data() {
			return {
				sblist: [],
				dataFormat:{YUSRNAM:'',YSSQNUM:'',YGBYY:'',FCY:'KX',yfsb:'',yfjh:'',yflb:''},
				dataModList: [],
				dataList: [],
				dataList2: {},
				astList1155:{},
				ast1155:[],
				astList15001:{},
				ast15001:[],
				yusrlist:[],
				loctyplist:[],
				userInfo: {},
				isClick: false,
				isclose: true,
				rules:{},
				form:{ysbitm:''},
				ynum:'',
				range: [
					{ value: "KX", text: "KX" },
					{ value: "MZ", text: "MZ" },
					{ value: "NZ", text: "NZ" },
				],
			}
		},
		onLoad(query) {
			// 从 query 中获取传递过来的数据，并将其转换为对象
			
			this.userInfo = uni.getStorageSync('userInfo')
			this.AST1155();
			this.AST15001();
			this.getUsr();
			this.getLoctyp();
			this.getysb();
			this.init();
			
			if(query.dataT){//设备提料
				 var dataT=JSON.parse(query.dataT);
				 this.dataFormat = dataT.dataFormat
				 this.dataModList = dataT.dataModList;
				 this.dataList=dataT.dataList;
				 this.addData();
			}else if(query.dataS){//库存
				 var dataS=JSON.parse(query.dataS);
				 this.dataFormat = dataS.dataFormat
				 this.dataModList = dataS.dataModList;
				 this.dataList=dataT.dataList;
				 this.addData2();
			}else if(query.dataformat){//单据中心
				 var dataformat=JSON.parse(query.dataformat);
				 this.dataFormat = dataformat
				 this.getData(this.dataFormat.YSSQNUM)
			}else{
				this.dataFormat.YUSRNAM=this.userInfo.NAME
				this.dataFormat.YSSQNUM=''
				this.dataFormat.YDAT=format(new Date(), 'yyyy-MM-dd');
				this.dataFormat.YSTAT="1";
			}
			
			if (this.dataFormat.YSTAT==3 || this.dataFormat.YSSQNUM==''){
				this.isclose=false
			}
		},
		methods: {
			checkSameYSBITM(dataList) {
			    if (!dataList?.length) return false;
			    const firstValue = dataList[0]?.YSBITM;
			    return dataList.every(item => item?.YSBITM === firstValue);
			  },
			  
			  checkContainsTilde(dataList) {
			    return dataList.some(item => item?.YSBITM?.includes('~'));
			  },
			  
			  ysubitm() {
			    if (!this.dataFormat?.YSBITM?.trim()) {
			      uni.$u.toast('填充设备不能为空');
			      return;
			    }
			
			    const isSame = this.checkSameYSBITM(this.dataList);
			    const hasTilde = this.checkContainsTilde(this.dataList);
			
			    if (!isSame) {
			      uni.$u.toast('明细设备不一致');
			      return;
			    }
			    
			    if (!hasTilde) {
			      uni.$u.toast('明细设备不是合并设备');
			      return;
			    }
			
			    this.dataList.forEach(item => {
			      item.YSBITM = this.dataFormat.YSBITM;
			    });
			  },
			
			init(){

			},
			changeFCY(e) {
			    this.dataFormat.FCY=e
				this.getLoctyp()
			},
			changeqty(item) {
				if(item.YSQTY>item.YKQTY){
					uni.$u.toast('不能大于可使用数量'+item.YKQTY)
					item.YSQTY=item.YKQTY
				}
			},
			// 解析形如"25-0001~25-0003"的字符串范围
			countRange(str) {
			  // 单编号情况（如"25-0001"）
			  if (!str.includes('~')) return 1
			  
			  const [start, end] = str.split('~')
			  const prefix = start.substring(0, start.lastIndexOf('-') + 1)
			  
			  // 提取起始和结束数字部分
			  const startNum = parseInt(start.replace(prefix, ''))
			  const endNum = parseInt(end.replace(prefix, ''))
			  
			  // 计算连续数量（含两端）
			  return endNum - startNum + 1
			},
			addData(){
				for(var i=0;i<this.dataModList.length;i++){
					var tildeCount =this.countRange(this.dataModList[i].YSBITM);
					var dividedValue = (this.dataModList[i].YJSQTY / tildeCount).toFixed(2);
					const newData = {
						YSBITM: this.dataModList[i].YSBITM, 
						YJH: this.dataModList[i].YJH, 
						YLJDES: this.dataModList[i].YLJDES, 
						CPNITMREF: this.dataModList[i].YCLITM, 
						YKQTY:this.dataModList[i].YJSQTY, 
						YSQTY:dividedValue, 
						YCZPH:this.dataModList[i].YCZPH,
						YGGXH:this.dataModList[i].YGGXH,
						YJSBZ:this.dataModList[i].YJSBZ,
						YFJJSYQ:this.dataModList[i].YFJJSYQ,
						YBZ:"",
						LOC:"",
						YCJH:"",
						LOCTYP:"",
						};
					this.dataList = [...this.dataList, newData];
				}
			},
			addData2(){
				for(var i=0;i<this.dataModList.length;i++){
					const newData = {
						YSBITM: this.dataModList[i].CTRNUM, 
						YJH: this.dataModList[i].YJH, 
						YLJDES: this.dataModList[i].ITMDES1, 
						CPNITMREF: this.dataModList[i].ITMREF, 
						YKQTY:this.dataModList[i].YKQTY, 
						YSQTY:this.dataModList[i].YKQTY, 
						YCZPH:this.dataModList[i].YCZPH,
						YGGXH:this.dataModList[i].YGGXX,
						YJSBZ:this.dataModList[i].YJSBZ,
						YFJJSYQ:this.dataModList[i].YFJJSYQ,
						YBZ:"",
						LOC:this.dataModList[i].LOC,
						YCJH:this.dataModList[i].LOT !== "" ? this.dataModList[i].LOT : this.dataModList[i].SERNUM ,
						LOCTYP:this.dataModList[i].LOCTYP,
						};
					this.dataList = [...this.dataList, newData];
				}
			},
			deleteData(index){
				if (this.dataFormat.YSSQNUM!=""){
					// uni.$u.toast('地点必填')
					return
				}
				var that_=this
				uni.showModal({
				  title: '提示',
				  content: '是否删除行？',
				  success: function (res) {
				    if (res.confirm) {
				      // 用户点击确定按钮
				      that_.dataList.splice(index, 1);
				    } else if (res.cancel) {
				      // 用户点击取消按钮
				      //this_.submitData(q,1);
				    }
				  }
				});
				
			},
			 changeYsbRang(e) {
				console.log("changeYsbRang",e)
			 },
			 inputYsbList(e){
				 console.log("inputYsbList",e)
				 const extractedContent = this.extractBracketContent(e.YSBITM);
				 e.YSBITM=extractedContent
				// this.form.ysbitm=extractedContent;
				// this.changeYsbRang(this.form.ysbitm);
			 },
			 inputYsbList2(e){
			 				 console.log("inputYsbList",e)
			 				 const extractedContent = this.extractBracketContent(e);
			 				 this.form.ysbitm=extractedContent
			 				// this.form.ysbitm=extractedContent;
			 				// this.changeYsbRang(this.form.ysbitm);
							console.log("this.form.ysbitm",this.form.ysbitm)
			 },
			 extractBracketContent(str) {
			   const regex = /【([^】]*)】/g;
			   const matches = str.match(regex);
			
			   if (matches) {
			     // 如果存在匹配项，我们只关心第一个（如果有多个）
			     // 并且去掉两边的中括号
			     const firstMatch = matches[0];
			     return firstMatch.replace(/【|】/g, '');
			   }
			
			   return str; // 如果没有找到匹配项，返回 null
			 },
			async getysb(){
				let GRP1 = {GRP1:[{TCLCOD:'FGMSN'}]}
				let res = await this.$api.x3.x3request("WSLISTYSB",GRP1)
			
					let cusbData = JSON.parse(res.message)
					this.ysbRang = cusbData.GRP1.map(item => {
					      return { value: item.ITMREF, text: item.ITMDES1 };
					    });
					this.sblist=[];
					for (var i = 0; i < cusbData.GRP1.length; i++) {
						this.sblist.push('【'+cusbData.GRP1[i].ITMREF+'】'+cusbData.GRP1[i].ITMDES1)
						// this.sblist.push(cusbData.GRP1[i].ITMREF)
					}
			
			},
			async AST1155() {
				let GRP1 = {
					GRP1: [{
						LANCHP: 1155
					}]
				}
				let res = await this.$api.x3.x3request("WSLISTAST",GRP1)
				// 请求成功的处理逻辑
				let resR1 = JSON.parse(res.message)
				this.astList1155= resR1.GRP1
				this.ast1155=[]
				var newObject={}
				for (var i = 0; i < this.astList1155.length; i++) {
					newObject = { value: this.astList1155[i].LANNUM, text: this.astList1155[i].LANMES};
					this.ast1155.push(newObject)
				}
			},
			async AST15001() {
				let GRP1 = {
					GRP1: [{
						LANCHP: 15001
					}]
				}
				let res = await this.$api.x3.x3request("WSLISTAST",GRP1)
				// 请求成功的处理逻辑
				let resR1 = JSON.parse(res.message)
				this.astList15001= resR1.GRP1
				this.ast15001=[]
				var newObject={}
				for (var i = 0; i < this.astList15001.length; i++) {
					newObject = { value: this.astList15001[i].LANNUM, text: this.astList15001[i].LANMES};
					this.ast15001.push(newObject)
				}
			},
			async getUsr(){
				let GRP1 = {}
				let res = await this.$api.x3.x3request("WSLISTYDR3",GRP1)
					let cusbData = JSON.parse(res.message)
					this.yusrlist=[];
					for (var i = 0; i < cusbData.GRP1.length; i++) {
						this.yusrlist.push(cusbData.GRP1[i].NAME)
					}
			},
			async getLoctyp(){
				let GRP1 = {GRP1: [{
						STOFCY: this.dataFormat.FCY
					}]}
				let res = await this.$api.x3.x3request("WSLISTTLO",GRP1)
					let cusbData = JSON.parse(res.message)
					this.loctyplist=[];
					for (var i = 0; i < cusbData.GRP1.length; i++) {
						this.loctyplist.push(cusbData.GRP1[i].TYPDES)
					}
			},
			showYSLModal(){
				if (this.dataFormat.YSSQNUM!=""){
					// uni.$u.toast('地点必填')
					return
				}
				if (this.dataFormat.FCY==""){
					uni.$u.toast('地点必填')
					return
				}
				if (this.dataFormat.YSTAT=="1"){
					var dataT={}
					dataT.dataFormat=this.dataFormat
					dataT.dataList=this.dataList
					console.log("dataT:",dataT)
					uni.navigateTo({url:"/pages/yssqleftPages/yslPages?dataFormat="+JSON.stringify(dataT)});
				}
			},
			showSTOModal(){
				if (this.dataFormat.YSSQNUM!=""){
					// uni.$u.toast('地点必填')
					return
				}
				if (this.dataFormat.FCY==""){
					uni.$u.toast('地点必填')
					return
				}
				if (this.dataFormat.YSTAT=="1"){
					var dataT={}
					dataT.dataFormat=this.dataFormat
					dataT.dataList=this.dataList
					uni.navigateTo({url:"/pages/yssqleftPages/ystoPages?dataFormat="+JSON.stringify(dataT)});
				}
			},
			outBtn(){
				uni.switchTab({url:"/pages/managementCenter/managementCenter"})
			},
			async getData(val){
				let GRP12 = {
					GRP1: [{
						YSSQNUM: val,
					}]
				}
				let res2 = await this.$api.x3.x3request("WSLISTSSQH",GRP12)
				let wpdData2 = JSON.parse(res2.message)
				this.dataFormat=wpdData2.GRP1[0]
				this.dataFormat.LOCTYP=wpdData2.GRP1[0].LOCTYP0
				this.dataFormat.YUSRNAM=wpdData2.GRP1[0].YUSR
				this.dataFormat.YSTAT=wpdData2.GRP1[0].YSTAT
				this.dataFormat.YDAT=wpdData2.GRP1[0].YDAT
				let res3 = await this.$api.x3.x3request("WSLISTSSQD",GRP12)
				let wpdData3 = JSON.parse(res3.message)
				this.dataList=wpdData3.GRP1
				for (var i = 0; i < this.dataList.length; i++) {
					this.dataList[i].YSBITM=this.dataList[i].ITMREF
					this.dataList[i].YKQTY=this.dataList[i].YSQTY
					if(this.dataList[i].YLCKQTY!=0){
						this.isclose=false
					}
				}
			},
			async creBtn(){
				if(this.isClick){
					console.log('重复点击')
					// return
				}
				
				if(this.dataList.length==0){
				 	uni.$u.toast('至少需要一条明细')
				 	return
				}
				if(this.dataFormat.FCY==""){
					uni.$u.toast('地点必填')
					return
				}
				if(this.dataFormat.YLLKF=="" || this.dataFormat.YLLKF=="1"){
					uni.$u.toast('库管员必填')
					return
				}
				var ymsg="";
				for (var i = 0; i < this.dataList.length; i++) {
					if(this.dataList[i].YSBITM=="" || this.dataList[i].YJH==""){
						ymsg="明细行设备，件号必填";
					}
				}
				if(ymsg!=""){
					uni.$u.toast(ymsg)
					return
				}
				this.isClick = true
				var loctyp=this.dataFormat.LOCTYP
				if (loctyp && loctyp!="" && /_/.test(loctyp)){
					loctyp=loctyp.split('_')[0]
				}
				let GRP1 = {
					GRP1: [{
						YFLG: 1,
						FCY: this.dataFormat.FCY,
						LOCTYP0: loctyp,
						YUSR: this.dataFormat.YUSRNAM,
						YLLKF: this.dataFormat.YLLKF,
						YGBYY: this.dataFormat.YGBYY,
					}]
				}
				GRP1.GRP2=[]
				for (var i = 0; i < this.dataList.length; i++) {
					GRP1.GRP2.push({
						ITMREF: this.dataList[i].YSBITM,
						YJH: this.dataList[i].YJH,
						YLJDES:  this.dataList[i].YLJDES,
						CPNITMREF:  this.dataList[i].CPNITMREF,
						YSQTY:  this.dataList[i].YSQTY,
						LOCTYP:  this.dataList[i].LOCTYP,
						LOC:  this.dataList[i].LOC,
						YCJH:  this.dataList[i].YCJH,
						YCZPH:  this.dataList[i].YCZPH,
						YGGXH:  this.dataList[i].YGGXH,
						YJSBZ:  this.dataList[i].YJSBZ,
						YFJJSYQ:  this.dataList[i].YFJJSYQ,
						YBZ: this.dataList[i].YBZ
					})
				}
				let res = await this.$api.x3.x3request("WSGENSSQ",GRP1)
				// 请求成功的处理逻辑
				let wpdData = JSON.parse(res.message)
				this.isClick = false
				if(wpdData.GRP3.WOK==0){
					// 显示创建成功的消息提示
					 uni.showToast({
					   title: '创建成功:'+wpdData.GRP3.WRESULT,
					   icon: 'success',
					   duration: 2000
					});
					this.dataFormat.YSSQNUM=wpdData.GRP3.WRESULT
					 // uni.switchTab({url:"/pages/managementCenter/managementCenter"})
					 // this.getDate(wpdData.GRP3.WRESULT)
				}else{
					uni.showToast({
					   title: '失败:'+wpdData.GRP3.WRESULT,
					   icon: 'error',
					   duration: 2000
					});
				}
			},
			async subBtn(){
				if(this.isClick){
					console.log('重复点击')
					return
				}
				this.isClick = true

				let GRP1 = {
					GRP1: [{
						YFLG: 2,
						YSSQNUM: this.dataFormat.YSSQNUM,
						YGBYY: this.dataFormat.YGBYY,
					}]
				}
				
				let GRP1Json = JSON.stringify(GRP1)
				let res = await this.$api.x3.x3request("WSGENSSQ",GRP1)
				// 请求成功的处理逻辑
				let wpdData = JSON.parse(res.message)
				this.isClick = false
				
				if(wpdData.GRP3.WOK==0){
					// 显示创建成功的消息提示
					 uni.showToast({
					   title: '提交成功:'+wpdData.GRP3.WRESULT,
					   icon: 'success',
					   duration: 2000
					});
					this.dataFormat.YSTAT="2"
					 uni.switchTab({url:"/pages/managementCenter/managementCenter"})
				}else{
					uni.showToast({
					   title: '失败',
					   icon: 'error',
					   duration: 2000
					});
				}
			},
			async cloBtn(){
				if(this.isClick){
					console.log('重复点击')
					return
				}
				if(this.dataFormat.YGBYY=="" || !this.dataFormat.YGBYY){
					uni.$u.toast('关闭原因必填')
					return
				}
				this.isClick = true
			
				let GRP1 = {
					GRP1: [{
						YFLG: 3,
						YSSQNUM: this.dataFormat.YSSQNUM,
						YGBYY: this.dataFormat.YGBYY,
					}]
				}
				
				let GRP1Json = JSON.stringify(GRP1)
				let res = await this.$api.x3.x3request("WSGENSSQ",GRP1)
				// 请求成功的处理逻辑
				let wpdData = JSON.parse(res.message)
				this.isClick = false
				
				if(wpdData.GRP3.WOK==0){
					// 显示创建成功的消息提示
					 uni.showToast({
					   title: '已关闭',
					   icon: 'success',
					   duration: 2000
					});
					this.dataFormat.YSTAT="3"
					 uni.switchTab({url:"/pages/managementCenter/managementCenter"})
				}else{
					uni.showToast({
					   title: '失败',
					   icon: 'error',
					   duration: 2000
					});
				}
			},
		}
	}
</script>

<style>
table{
	border-collapse: collapse;
	text-align: center;
}
table1,th,td{
	border: 1px solid gainsboro ;
}
.table-container {
  /* width: 620px; */
  overflow: auto;
	background-color: white;
	/* height: 300px; */
}

table1 {
  width: 95%; /* 表格宽度占满容器 */
  table-layout: fixed; /* 固定表格布局 */
}

td1 {
  width: 25%; /* 每列宽度为容器宽度的四分之一 */
}
.top{
	width: 95%;
	background-color: white;
	position: relative;
	top: 50rpx;
	margin: 0 auto;
}
.topOne{
	height: 90rpx;
	border-bottom: 1px solid #ccc;
	display: flex;
	justify-content: space-between;
}
.topOne-left{
	width: 200rpx;
	font-weight: bold;
	font-size: 36rpx;
	text-align: center;
	padding-top: 20rpx;
}
.topOne-right{
	width: 400rpx;
	text-align: center;
	padding-top: 20rpx;
	color: gray;
	font-size: 28rpx;
}
.two{
	background-color: white;
}
.two-one{
	display: flex;
	justify-content: left;
	margin-top: -10px;
}
.two-oneLeft{
	width: 190rpx;
	line-height: 65rpx;
	color: gray;
	font-weight: bold;
	/* font-size: 20; */
	text-align: left;
}
.two-oneRight{
	width: 350rpx;
	line-height: 68rpx;
	color: gray;
	text-align: left;
}
.two2{
	background-color: white;
}
.two2-one{
	height: 60rpx;
	display: flex;
	justify-content: space-between;
}
.two2-oneLeft{
	width: 190rpx;
	line-height: 68rpx;
	color: gray;
	text-align: center;
}
.two2-oneRight{
	width: 350rpx;
	line-height: 68rpx;
	color: gray;
	text-align: center;
}
.wxxx{
	width: 90%;
	background-color: white;
	position: relative;
	top: 100rpx;
	margin: 0 auto;
}
.wxxxOne{
	height: 90rpx;
	border-bottom: 1px solid #ccc;
	display: flex;
	justify-content: space-between;
}
.wxxxOne-left{
	width: 230rpx;
	font-weight: bold;
	font-size: 36rpx;
	text-align: center;
	padding-top: 20rpx;
}
.ddlcjlBox{
	width: 90%;
	position: relative;
	top: 160rpx;
	margin: 0 auto;
	background-color: white;
	font-size: 28rpx;
}
.ddlcjlBox-top{
	height: 70rpx;
	color: gray;
	text-align: center;
	font-size: 38rpx;
	padding-top: 15rpx;
}
.ddlcjlBox-two{
	height: 50rpx;
	display: flex;
	justify-content: space-between;
	color: gray;
	padding-left: 15rpx;
}
.ddlcjlBox-twoLeft{
	width: 320rpx;
}
.ddlcjlBox-twoCenter{
	width: 100rpx;
}
.ddlcjlBox-twoRightr{
	width: 100rpx;
}
.bcjlBox{
    width: 90%;
	height: 70rpx;
	position: relative;
	top: 200rpx;
	margin: 0 auto;
	background-color: white;
	color: gray;
	font-size: 32rpx;
	padding-top: 20rpx;
	padding-left: 20rpx;
}
.jlBox{
	width: 90%;
	height: 00rpx;
	position: relative;
	top: 100rpx;
	margin: 0 auto;
	background-color: white;
	font-size: 42rpx;
	padding-top: 0rpx;
	padding-left: 300rpx;
}
.btnBox{
	width: 100%;
	height: 80rpx;
	position: relative;
	top: 0rpx;
	left: -270rpx;
	display: flex;
	justify-content: space-between;
}
.btnBox-left{
	width: 350rpx;
	border-right: 1px solid #ccc;
}
.btnBox-right{
	width: 350rpx;
}

</style>
